<?php

namespace app\admin\validate\Coupon;

use think\Validate;

class Relation extends Validate
{
    protected $rule = [
        'brand_id' => 'require',
        'cate_id' => 'require',
        'brand_ids' => 'require|array',
    ];

    protected $message = [
        'cate_id.require' => '分类编号不能为空！',
        'brand_id.require' => '品牌编号不能为空！',
        'brand_ids.require' => '请选择关联品牌！',
        'brand_ids.array' => '品牌必须为数组！'
    ];

    protected $scene = [
        'add_relation' => ['cate_id', 'brand_ids'],
        'del_relation' => ['cate_id','brand_id']
    ];
}
